<%@include file="template/configuration.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>${website} || Manage quiz</title>
        ${stylesheet}
        ${jquery}
        ${jsdropdown}
    </head>
    <body>
        <div class="container">
            <%@include file="template/header.jsp" %>
            <div class="content">
                <h1>Manage quiz</h1>
                <h3>
                    <c:choose>
                        <c:when test="${Quizedit!=null}">Edit</c:when>
                        <c:otherwise>Add</c:otherwise>
                    </c:choose>quiz in course ${course.name}
                </h3>

                <c:choose>
                    <c:when test="${Quizedit==null}">                        
                        <form action="ManageQuiz" method="POST" name="Quizadd">                    
                            <input type="hidden" name="formoption" value="Quizadd"/>
                        </c:when>
                        <c:otherwise>
                            <form action="ManageQuiz" method="POST" name="Quizedit">                    
                                <input type="hidden" name="formoption" value="Quizedit"/>
                            </c:otherwise>                    
                        </c:choose>
                        <label for="name">Name</label> 
                        <input type="text" name="name" id="name" value="${Quizedit.name}" required/>
                        </br>
                        <input type="hidden" name="courseid" value="${course.id}"/>
                        <label for="description">Description</label> 
                        <textarea name="description" id="description" required>${Quizedit.description}</textarea>
                        </br>
                        <input type="hidden" name="quizid" value="${Quizedit.id}"/>

                        <label>&nbsp;</label> 
                        <input type="submit" value="Save quiz"/>
                    </form>

            </div>
            <%@include file="template/footer.jsp" %>
        </div>
    </body>
</html>